package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @author XCQ
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource(name = "userDao")
//    @Autowired(required = false)
//    @Qualifier("userDao")
    private UserDao userDao;

    public UserServiceImpl(){
        System.out.println("userService  init...");
    }

    @Override
    public void add() {
        userDao.add();//调用方法
        //System.out.println("add run ...");
    }

    @Override
    public String getName(String data) {
        return data;

    }
}
